package com.fanbuchi.app.ins.manager;



import com.fanbuchi.app.ins.BuildConfig;
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;


/**
 * Created by win7 on 2016/5/23.
 */
public class ObjectMapperManager {
    private static final ObjectMapper mMapper = new ObjectMapper();

    public static  ObjectMapper getMapper() {

        mMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,true);
        if (BuildConfig.DEBUG){
            mMapper.configure(SerializationFeature.INDENT_OUTPUT,true);
        }
        mMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
        mMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
        return mMapper;
    }

}
